package com.training.permission.service.impl.chengshu;

import java.util.List;

import com.training.perimission.dao.chengshu.IPermission;
import com.training.permission.service.chengshu.IPermissionService;
import com.training.pojo.chengshu.IsRolePermission;
import com.training.pojo.chengshu.UFunction;
import com.training.pojo.chengshu.URole;
import com.training.pojo.chengshu.UUser;
import com.training.pojo.chengshu.UserRole;

public class PermissionServiceImpl implements IPermissionService {
	
	private IPermission permissions;
	
	public void setPermissions(IPermission permissions) {
		this.permissions = permissions;
	}
	
	public List<URole> listRole(Integer start,Integer end,String str) {
		return permissions.listRole(start, end, str);
	}

	public Integer countRole(String str) {
		return permissions.countRole(str);
	}


	public List<UUser> listUser(Integer start, Integer max, String str) {
		return permissions.listUser(start, max, str);
	}
	
	public Integer countUser(String str) {
		return permissions.countUser(str);
	}
	//新增角色业务
	public boolean newRole(URole role) {
		return permissions.newRole(role);
		
	}
	//删除角色业务
	public boolean delRole(List<Integer> id) {
		return permissions.delRole(id);
	}

	//修改员工角色
	public boolean updateUserRole(UserRole role) {
		return permissions.updateUserRole(role);
	}

	//遍历角色
	public List<URole> listRole(Integer id) {
		return permissions.listRole(id);
	}
	
	//搜索员工的角色号
	public URole queryRoleId(Integer id) {
		return permissions.queryRoleId(id);
	}

	//遍历角色权限
	public List<UFunction> listuf(URole role) {
		return permissions.listuf(role);
	}

	//遍历所有权限
	public List<UFunction> listAllUF() {
		return permissions.listAllUF();
	}

	//设置前台权限显示
	public List<IsRolePermission> listRolePer(List<UFunction> list,
			List<UFunction> allList) {
		return permissions.listRolePer(list, allList);
	}

	//修改权限
	public boolean updatePermission(String[] id,String roleid) {
		return permissions.updatePermission(id, roleid);
	}

}
